package StudyCode.summary.mycollection;

import java.util.ListIterator;
import java.util.Vector;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class IterateThroughElementsOfVectorUsingListIterator {
	public static void main(String[] args) {
		Vector v = new Vector();
		v.add("1");
		v.add("2");
		v.add("3");
		v.add("4");
		v.add("5");

		ListIterator itr = v.listIterator();

		System.out.println("Vector 元素向后遍历...");
		while (itr.hasNext())
			System.out.println(itr.next());

		System.out.println("Vector 元素向前遍历...");
		while (itr.hasPrevious())
			System.out.println(itr.previous());

	}
}
